|
- <template>
- <div />
- </template>
-
- <script setup>
- import { articleUrl, useArticleDetail } from '~/composables/useArticle'
-
- /**
- * 旧 sitemap 与历史内链使用 /news/detail/{id}.html。
- * 先按文章 id 查询所属栏目,再服务端 301 到唯一的 /info/... 规范地址。
- */
- const nuxtApp = useNuxtApp()
- const { detail } = await useArticleDetail()
-
- await nuxtApp.runWithContext(() =>
- navigateTo(articleUrl(detail.value), { redirectCode: 301, replace: true }))
- </script>
|